Setting up a Rest Service Proxy
The first step is to setup a proxy controller for the remote Rest Service.
In order to achieve this, an 'empty' (no rules processing) Proxy controller needs to be setup. This can be achieved by opening the Project Settings tab and clicking on the Runtime Patterns tab. Typically, click on the Model layer to set-up a Remote Proxy Controller that will be mapped to the physical Rest Service. Type in the New Filename for the reference to the controller you want to call, e.g. {RemoteControllerName_Rest_Proxy}and click on the Clone Pattern button. This will display another screen that enables the selection of the Base Pattern to be used - In this case the
Remote_Service_Proxy.xmlfile. Finally, click on the Clone Pattern button to create the controller. Once this is done, open the Test Settings and select the Agent Types menu option. Click on the Agent Id for the controller just created, and then change its Agent Type to
Web Service Proxy. The Service Type field should be correctly defaulted to
HTTP Service. Enter the Web Service URI as the full URL for the Rest Service. Ensure you tick the Allow Advanced Features option if you need to dynamically alter the URL for the Rest Service at runtime, or need to pass dynamic
Parametersto the service. Then click on the Change Agent Type to commit the changes. Finally, this proxy controller, in the model layer, can then be configured for invocation from other controllers using an Invoke Service action. This proxy controller acts as a gateway to the actual Rest Service. This means that the URL (or at least the static part of the URL) can be amended in the External Calls section within the Publish Settings for different publication targets. To configure the runtime calls you need to insert the HttpHeader fragment into the request message before the Invoke Service action. Without the 'Insert REST Header' action being available you will need to use a generic Insert action, and manually paste in the fragment discussed in the previous section.